oracle.hadoop.balancer.examples.movie

## Class MovieGenre.MovieGenreMapper

- java.lang.Object
- - org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>
  - - oracle.hadoop.balancer.examples.movie.MovieGenre.MovieGenreMapper

- Enclosing class:
    MovieGenre

      public static class MovieGenre.MovieGenreMapper
      extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>

  Movie-demo mapper class for `TextInputFormat` This class used the second element and third element of every row as movie-id and genre-id respectively.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper

      `org.apache.hadoop.mapreduce.Mapper.Context`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MovieGenre.MovieGenreMapper()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `map(org.apache.hadoop.io.LongWritable keyIn, org.apache.hadoop.io.Text valueIn, org.apache.hadoop.mapreduce.Mapper.Context context)` The map function parses the second and third element of every row as movie-id and genre-id.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.Mapper

      `run`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MovieGenre.MovieGenreMapper

          public MovieGenre.MovieGenreMapper()

  - ### Method Detail

    - #### map

          public void map(org.apache.hadoop.io.LongWritable keyIn,
                 org.apache.hadoop.io.Text valueIn,
                 org.apache.hadoop.mapreduce.Mapper.Context context)
                   throws java.io.IOException,
                          java.lang.InterruptedException

      The map function parses the second and third element of every row as movie-id and genre-id. These two elements must be integers otherwise this mapper will throw `NumberFormatException`.
      Overrides:
        `map` in class `org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text,org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable>`
      Throws:
        `java.io.IOException`
        `java.lang.InterruptedException`

Copyright © 2013, 2016, Oracle and/or its affiliates. All rights reserved.